<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //求a的所有约数的和
        function excess(a){
            var sum = 0;
            for(var i = 1;i < a;i++){
                if( a % i === 0){
                    sum+=i;
                }
            }
            return sum;
        }
        //判断约数和是否大于a
        function isExcess(a){
            if(excess(a) > a){
                return true;
            }else{
                return false;
            }
        }
        //求出从0开始到a之间的所有因数和大于a的数
        function ex(a){
            for(var i = 0;i < a;i++){
                if(isExcess(i)){
                    console.log(i);
                }
            }
        }
        ex(100);
    </script>
</head>
<body>
    
</body>
</html>